package com.juc.phaser.phaser8;

import java.util.concurrent.Phaser;

public class MyThread extends Thread {
    /**
     * getArrivedParties() 获得已经使用的parties 个数
     * getUnarrivedParties()获得未使用的parties 个数
     */
	private Phaser phaser;
	
	public MyThread(Phaser phaser){
		super();
		this.phaser = phaser;
	}
	@Override
	public void run() {
		System.out.println(Thread.currentThread().getName() + " A1 beging " + System.currentTimeMillis());
		phaser.arriveAndAwaitAdvance();
		System.out.println(Thread.currentThread().getName() + " A1 end " + System.currentTimeMillis());

	}
}
